import { Checkbox } from '@alifd/next';
import { data } from '@alifd/next/types/checkbox';
import React from 'react';

interface Props {
  dataSource: string[] | data[] | number[];
}

export default function SingleCheckboxGroup(props: Props) {
  const check = React.useState<string | undefined>();
  return (
    <Checkbox.Group
      value={check[0]}
      dataSource={props.dataSource}
      onChange={(value) => {
        check[1](value.pop());
      }}
    />
  );
}
